﻿using System;
using UnityEngine;
using UnityEngine.UI;

public class InputUI : MonoBehaviour
{
    public InputField inputText;
    public Action<string> onInputSubmit;

    string curText;

    void Start()
    {
        inputText.onValueChanged.AddListener(OnTextInput);
    }
    public void OnTextInput(string value)
    {
        GameDebug.Log($"OnTextInput:{value}");

        curText = value;
    }

    public void OnClickConfirm()
    {
        onInputSubmit?.Invoke(curText);
    }
}